#ifndef VECTOR2D_
#define VECTOR2D_

#include <cmath>

class Vector2D {
private:
    float x_;
    float y_;
public:
    Vector2D() = default;
    Vector2D(float x, float y);
    float getx() const;
    float gety() const;
    void setx(float x);
    void sety(float y);

    float length();

    Vector2D operator+(const Vector2D& other) const;

    friend Vector2D& operator+=(Vector2D& other1, const Vector2D& other2);

    Vector2D operator*(const float n);

    Vector2D& operator*=(const float n);

    Vector2D operator-(const Vector2D& other);

    friend Vector2D& operator-=(Vector2D& other1, const Vector2D& other2);

    Vector2D operator/(const float n);

    Vector2D& operator/=(const float n);

    void Normalize();
};

#endif // VECTOR2D_
